<template>
  <div class="c-flex-column" :class="!isSetPageBackground ? 'c-bg-white' : ''">
    <cust-title-com
      :marginSettings="item.styleParam && item.styleParam.marginSettings ? item.styleParam.marginSettings : null"
      :headLine="item.styleParam && item.styleParam.headLine ? item.styleParam.headLine : null"
      :position="item.items.position"
      :titleName="item.items.text"
      :showMore="item.items.isShowMore ? 0 : 1" :showMoreType="item.items.showMoreType" @clickMore="clickItem"></cust-title-com>
    <div :class="item.isWhitespace == 1 ? '':'c-pb24'" :style="item.isWhitespace == 0 && item.styleParam && item.styleParam.marginSettings ? getVerticalSpacing(item.styleParam.marginSettings, 2) : ''">
      <div v-if="item.items.content" :style="item.styleParam && item.styleParam.marginSettings ? getHorizontalSpacing(item.styleParam.marginSettings) : ''"
        :class="[item.items.position == 1 ? 'c-textAlign-l' : 'c-textAlign-c', pageTextColor ? 'pageTextColor' : 'c-fc-sblack']" class="c-fs24 c-fc-sblack c-ws-pw c-ph24">{{item.items.content}}</div>
    </div>
  </div>
</template>
<script>
import { custIndex, } from "@/mixin/custIndex.js";
import { customStyle } from '@/utils/customStyle.js'
import custTitleCom from "@/components/templates/custIndexTemp/custTitleCom.vue";
export default {
  mixins: [custIndex, customStyle],
  components: {
    custTitleCom
  },
  props: {
    item: {
      type: Object,
      default: () => {
        return {}
      },
    },
    upgradeMemberJump: {
      type: String,
      default: ''
    },
    pageName: {//首页 INDEX 预览页 PREVIEW_INDEX 微页面 MICRO_PAGE
      type: String,
      default: "INDEX"
    },
  },
  data() {
    return {
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      navMap: global.navMap,
      isSetPageBackground: sessionStorage.getItem("isSetPageBackground") || 0,
      pageTextColor: sessionStorage.getItem('pageTextColor') || ''
    };
  },
  methods: {
    // 点击导航
    clickItem() {
      let data = this.item.items;
      data.pageName = this.pageName;
      data.upgradeMemberJump = this.upgradeMemberJump;
      this.commonModuleRouterPush(data)
    },
  },
};
</script>

<style scoped>
.search-bg {
  border-radius: 0.2rem;
  background: #f4f7f9;
}
.fixedTop {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  margin: 0 auto;
  max-width: 16rem;
}
</style>
